package com.example.administrator.himalaya.fragment;

//订阅
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.administrator.himalaya.R;
import com.example.administrator.himalaya.criticallies.SecondFragment;

/**
 * A simple {@link Fragment} subclass.
 */
public class FragmentSubscibe extends Fragment implements View.OnClickListener {


    private Button button;

    public FragmentSubscibe() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_fragment_subscibe, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        button = (Button) view.findViewById(R.id.fragment_history_button);
        button.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        SecondFragment secondFragment = (SecondFragment) getParentFragment();
        secondFragment.getViewPager().setCurrentItem(0);

    }
}
